using System;
using System.Data;
using System.Linq;
using System.ComponentModel;
using System.Reflection;
using System.Collections.Generic;
using DataObject.Database;
using DataObject.Model;

	public partial class ProviderContactMapper
	{
		#region ToEntity

		public static ProviderContact ToEntity(ProviderContact entity, ProviderContactDTO businessobject)
		{
			if (businessobject == null)
			{
				return null;
			}
			entity.ContactID = businessobject.ContactID;
			entity.Department = businessobject.Department;
			entity.JobTitle = businessobject.JobTitle;
			entity.ProviderContactID = businessobject.ProviderContactID;
			entity.ProviderID = businessobject.ProviderID;
			return entity;
		}

		#endregion

		#region ToBusinessObject

		public static ProviderContactDTO ToBusinessObject(ProviderContact entity)
		{
			if (entity == null)
			{
				return null;
			}
			return new ProviderContactDTO
			{
				ContactID = entity.ContactID,
				Department = entity.Department,
				JobTitle = entity.JobTitle,
				ProviderContactID = entity.ProviderContactID,
				ProviderID = entity.ProviderID,
				Contact = ContactMapper.ToBusinessObject(entity.Contact),
				Provider = ProviderMapper.ToBusinessObject(entity.ProviderEntity)
			};
		}

		#endregion

		#region ToBusinessObjectHasChildren

		public static ProviderContactDTO ToBusinessObjectHasChildren(ProviderContact entity, params Type[] types)
		{
			if (entity == null)
			{
				return null;
			}
			ProviderContactDTO businessobject = new ProviderContactDTO
			{
				ContactID = entity.ContactID,
				Department = entity.Department,
				JobTitle = entity.JobTitle,
				ProviderContactID = entity.ProviderContactID,
				ProviderID = entity.ProviderID,
				Contact = ContactMapper.ToBusinessObject(entity.Contact),
				Provider = ProviderMapper.ToBusinessObject(entity.ProviderEntity),
			};
			return businessobject;
		}

		#endregion

	}
